<?php
/**
 * 搜窝
 *
 * @copyright 搜窝( www.souvo.com )
 * @package 前台用户登录
 * @version 1.0
 * @author wybwsk(wybwsk@qq.net)
 * @date 2011/5/2
 */
class MainAction extends FrontAction{
    protected function init() {
        $this->assign('user',$this->user);
        $this->assign('user_info',$this->user_info);
    }
    public function index() {
        $data = S('generat.php','',1800,'File');
        if(empty($data)) {
            $data = M('member_info')->where(array('recommend'=>1))->order('`rorder` DESC')->findAll();
            $limit = 31 -count($data);
            if($limit > 0) {
                $tmp_data = M('member_info')->where(array('recommend'=>0))->order('`update_time` DESC')->limit("0,$limit")->findAll();
                $data = array_merge($data,(array)$tmp_data);
            }
            S('generat.php',$data,1800,'File');
        }
        $first_data = array_shift($data);
        $this->assign('procity',W('proCity',array(),true));
        $this->assign('data',$data);
        $this->assign('first_data',$first_data);
        $this->display();
    }
    private function generat() {

    }
    public function people() {
        $data = M('member_info')->where(array('recommend'=>2))->order('`rorder` DESC')->findAll();
        $first_data = array_shift($data);
        $this->assign('procity',W('proCity',array(),true));
        $this->assign('data',$data);
        $this->assign('first_data',$first_data);
        $this->display();
    }
    public function blog() {
    }
}
